<?php

namespace app\command;

use think\console\Command;
use think\console\Input;
use think\console\input\Argument;
use think\console\input\Option;
use think\console\Output;
use think\facade\Db;

class Swoole3 extends Command
{
    protected function configure()
    {
        // 指令配置
        $this->setName('test')
            ->setDescription('the test command');        
    }

    protected function execute(Input $input, Output $output)
    {
    	// 指令输出
    	//$output->writeln('test');
        $data['name'] = 'haha_'.date('his');
        $data['sex'] = 0;
        $data['created_at'] = date('Y-m-d H:i:s');
        Db::table('users')->insert($data);
        file_put_contents(__DIR__.'/crontab.log',date('Y-m-d H:i:s').'任务执行成功！'."\r\n",FILE_APPEND);
    }
}
